home *** CD-ROM | disk | FTP | other *** search
- /*
- File: ProcessShape.h
-
- Contains: QuickDraw GX to PostScript conversion code.
- this file contains the definitions and data structures that are needed
- to invoke the routines that deal with various shapes
-
- Version: Technology: Quickdraw GX 1.1.x
-
- Copyright: © 1991-1997 by Apple Computer, Inc., all rights reserved.
- */
-
-
- #ifndef __PROCESSSHAPE__
- #define __PROCESSSHAPE__
-
- #include <GXGraphics.h>
-
- #define kStackListIncrement 8
-
- typedef struct {
-
- gxShape sh;
-
- long mark;
- long count;
-
- gxStyle savestyle;
- gxInk saveink;
- gxTransform savetransform;
-
- } TShapeNMark;
-
- typedef struct {
-
- gxTransform **list;
-
- long top;
- long mark;
- long count;
- long seed;
-
- gxShapeType cliptype;
-
- } TTransformList;
-
-
- typedef struct {
-
- TShapeNMark **stack; // this is the shape stack
-
- long mark;
- long count;
-
- TTransformList tr; // this is the concatenated list of transform for this shape
-
- gxShape sh;
- long index;
-
- gxStyle savestyle; // these fields are internal and are used for traversing the picture
- gxInk saveink;
- gxTransform savetransform;
-
- gxStyle newstyle;
- gxInk newink;
- gxTransform newtransform;
-
- } TShapeStack;
-
- typedef struct {
-
- gxRectangle pagebounds;
- gxPoint pixelsize;
-
- } TBBoxParam;
-
-
- typedef struct {
-
- gxShape sh; // <- the shape to draw
- gxRectangle shbbox; // <- the bounds for this shape
-
- gxStyle st; // <- the overriding style to use
- gxInk tm; // <- the overriding ink to use when drawing it
- gxTransform tr; // <- the overriding transform to use
-
- TShapeStack stack; // -> the shape stack
- TBBoxParam bp; // -> the page bounds
-
- } TResolveParam;
-
-
- typedef struct {
-
- gxShape root;
- gxShape branch;
- gxShape node;
-
- short seed;
-
- gxStyle rootst;
- gxInk roottm;
- gxTransform roottr;
-
- } TRNABlock;
-
- typedef struct {
-
- long mark; // what shape to get next
- long count; // up to what shape we should go till (same as index in TShapeStack)
-
- gxInk tm; // the transfer mode to apply to all the shapes behind
- gxShape sh; // the shape that this block represents
- gxRectangle shbbox; // the bounding rectangle of the clip
-
- } TTModeBlock;
-
- typedef struct {
-
- TTModeBlock **stack;
-
- long mark;
- long count;
-
- } TTModeStack;
-
-
- typedef struct {
-
- gxShape sh;
- gxStyle savestyle;
- gxInk saveink;
- gxTransform savetransform;
-
- } TTMShapeOverrides;
-
- typedef struct {
-
- long movedata[ sizeof( gxSetColor ) >> 2 ];
-
- } TTMColorValues;
-
-
-
- #define emptystackq( stackPtr ) ( (stackPtr)->mark == 0 )
- #define emptyrectangle( r ) ( ( ( (r)->right <= (r)->left ) || ( (r)->bottom <= (r)->top ) ) )
-
- /* public routines */
-
- void TMBoundsToPoints( gxPoint corners[], const gxRectangle *boundsPtr );
- void TMPointsToBounds( gxRectangle *boundsPtr, const gxPoint corners[] );
-
- void TMGetShapeBounds( gxRectangle *boundsPtr, gxShape sh, TShapeStack *stackPtr, TBBoxParam * );
-
-
-
- OSErr TMNewStack( TShapeStack * );
- void TMDisposeStack( TShapeStack * );
-
- OSErr TMPushShape( TShapeStack *, gxShape );
- void TMPopShape( TShapeStack * );
- void TMRewindStack( TShapeStack * );
- void TMPeekShape( gxShape *, long *, long *, TShapeStack * );
-
- gxShape TMGrabShape( TShapeStack * );
- void TMFixOverrides( gxShape, gxStyle, gxInk, gxTransform, TTMShapeOverrides * );
- void TMRestoreOverrides( TTMShapeOverrides * );
- gxShape TMNextShape( TShapeStack * );
- void TMSkipShape( TShapeStack * );
- void TMFreeShape( TShapeStack * );
-
- OSErr TMConcatenateTransform( TTransformList *, gxTransform );
- OSErr TMInsertTMClip( TTransformList *, gxTransform );
- void TMRemoveTMClip( TTransformList * );
-
- OSErr TMResolveShape( TResolveParam *, Boolean doresolve );
- void TMReleaseShape( TResolveParam * );
-
- void TMAttachShape( TRNABlock *, gxShape , gxInk , TShapeStack * );
- void TMAttachShapeSimple( TRNABlock *, gxShape, TShapeStack * );
-
- Boolean TMTestOrMode( gxInk );
- Boolean TMTestCopyMode( gxInk );
- Boolean TMTestComponentMode( gxTransferComponent *, unsigned char );
- short TMGetSpaceComponentCount( gxColorSpace );
- OSErr TMNewTModeStack( TTModeStack * );
- void TMDisposeTModeStack( TTModeStack * );
- OSErr TMPushTMBlock( TTModeStack *, gxShape, gxRectangle *, TShapeStack * );
- void TMPopTMBlock( TTModeStack *, TShapeStack * );
- void TMPeekTMBlock( long *, long *, gxRectangle *, TTModeStack * );
- void TMBumpTMBlock( TTModeStack *, TShapeStack * );
- void TMCombineColors( gxColor *, gxInk, TTModeStack * );
- Boolean TMTestIdentityMapping( gxMapping * );
- Boolean TMTestPerspectiveShape( gxShape );
- void TMFixTransferMode( gxInk );
- void TMFixComponent( gxTransferComponent *, gxColorValue );
- gxShape TMCombineBitmapColors( gxShape, gxInk, TTModeStack *, gxRectangle *, TTransformList *);
- gxShape TMGetBitmapPart( gxShape, gxRectangle *, TTransformList *, gxPoint *);
- Boolean TMGetDeviceMapping( gxMapping *, gxShape, TTransformList *);
- gxShape TMResolveBitmap( TShapeStack *, TTModeStack *, gxRectangle *);
- gxColor *TMMakeWhite( gxColor * );
-
- typedef OSErr (*TMShapeProcPtr)(gxShape, long);
-
- OSErr TMTraversePicture(gxShape, long, TMShapeProcPtr);
-
- #endif
-